import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createPinia } from 'pinia'
import store from './store'
import global from './config/global'

// 导入全局样式
import '@/assets/scss/index.scss'

import App from './App.vue'
import router from './router'

const app = createApp(App)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册全局配置
app.config.globalProperties.$global = global

// 使用插件
app.use(ElementPlus)
   .use(createPinia())
   .use(router)
   .use(store)

// 挂载应用   
app.mount('#app')
